package com.ynny.service;

import com.ynny.dao.UserDao;
import com.ynny.entity.User;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class UserSeriviceImpl implements UserService {

    @Autowired
    UserDao userDao;


    @Override
    public int resigister(User user) {
        List<User> repeatUser = userDao.selectUserByUserName(user.getNumber());
        if (repeatUser != null){

            return 404;
        }
        int i = userDao.insertUser(user);

        if (i != 1){
            return 500;
        }
        return 405;
    }
}